package com.ztsoft.user.controller.dynamic;

import com.ztsoft.user.common.base.NewBaseController;
import com.ztsoft.user.pojo.entity.dynamic.DynamicForm;
import com.ztsoft.user.service.dynamic.DynamicFormService;
import com.ztsoft.user.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 动态表单控制器
 */
@RestController
@RequestMapping("/dynamicForm")
@Api(tags = "动态表单模块")
@CrossOrigin("*")
public class DynamicFormController extends NewBaseController<DynamicForm, String, DynamicFormService> {

    @PostMapping("/saveDynamicForm")
    @ApiOperation(value = "保存")
    public Result<Object> saveDynamicForm(@RequestBody DynamicForm dynamicForm) {
        return baseService.saveDynamicForm(dynamicForm);
    }

    @GetMapping("/queryDynamicFormByPage")
    @ApiOperation(value = "带分页查询")
    public Result<Object> queryDynamicFormPage(DynamicForm dynamicForm, Integer currentPage, Integer pageSize) {
        return baseService.queryDynamicFormPage(dynamicForm, currentPage, pageSize);
    }
}
